GitHub Workflows
This repository uses three automated workflows for CI/CD and content management.
1. Continuous Deployment (cd.yml)
Trigger: Push to main or preview
Purpose: Build the Docker image and deploy it. A push to main updates abair.ie, and a push to preview updates preview.abair.ie.
Both jobs run on the organisation's self-hosted runner (on the docker-build VM), in the prod environment.
Steps:
-
Build and push the image
- Builds the
Dockerfile, passing the build-time variables as build args (see Environment Variables) - Pushes to the internal registry as
10.0.0.12:5000/abair_website, tagged:mainor:previewafter the branch - There's no login step: the runner is already logged in to the registry (set up by
setup-docker-build.ymlininfrastructure-automation)
- Builds the
-
Deploy to services-user
- Connects as
deploy@10.0.0.18and runsdocker compose pull && docker compose up -din/opt/apps/abair_website - The compose file defines both the main and preview containers, so this one step covers both. Only the container whose tag changed is recreated.
- Connects as
Required Configuration:
| Type | Name | Purpose |
|---|---|---|
Variable (prod environment) | NEXT_PUBLIC_SUPABASE_URL | Supabase project URL |
Variable (prod environment) | NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY | Supabase publishable key |
There are no GitHub secrets. Runtime secrets such as OPENAI_API_KEY live in the server's .env, not in CI.
2. Continuous Integration (ci.yml)
Trigger: Pull requests to main branch
Purpose: Verify builds succeed before merging
Steps:
- Checkout code
- Setup Node.js 18.16.0
- Install dependencies (
npm i)
Note: Currently only validates dependency installation. No build/test steps configured.
3. Update Translations (update_translations.yml)
Trigger: Repository dispatch event with type update-translations
Purpose: Allow programmatic updates to translation files from external systems
Steps:
-
Verify Requester
- Checks if the requesting user is a repository collaborator
- Aborts if user lacks permissions
-
Update Translation File
- Receives file path and content via event payload
- Creates/updates JSON translation file
-
Commit & Push
- Commits changes directly to
mainbranch - Uses requester's username for git author
- The push triggers
cd.yml, so translation updates go straight toabair.ie
- Commits changes directly to
Event Payload Requirements:
{
"username": "github-username",
"file_path": "locales/resources.json",
"content": "{ ... JSON content ... }",
"commit_message": "Update translations"
}
Use Case: Integration with translation management systems or automated localization tools.
Workflow Execution
- cd.yml: Runs automatically on every push to
mainorpreview - ci.yml: Runs automatically on all PRs targeting
main - update_translations.yml: Triggered manually via API:
curl -X POST \-H "Authorization: token $GITHUB_TOKEN" \-H "Accept: application/vnd.github.v3+json" \https://api.github.com/repos/OWNER/REPO/dispatches \-d '{"event_type":"update-translations","client_payload":{...}}'